package day04;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * 创建一个List集合并添加元素0-9
 * 然后获取子集[3,4,5,6]
 * 然后将子集元素扩大10倍
 * 然后输出原集合。
 * 之后删除集合中的[7,8,9]
 * @author Bonnie
 *
 */
public class Test04 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list,0,1,2,3,4,5,6,7,8,9);
        List<Integer> subList = list.subList(3, 7);
        for (int i = 0; i < subList.size(); i++) {
            subList.set(i, subList.get(i)*10);
        }
        List<Integer> subList1 = list.subList(7, 10);
        list.removeAll(subList1);
        System.out.println(list);
    }
}
